{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "%matplotlib inline\n",
    "import matplotlib.pyplot as plt\n",
    "import torch\n",
    "import torch.nn as nn\n",
    "import torchvision\n",
    "from torch.utils import data\n",
    "from torchvision import transforms\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 获取数据集\n",
    "mnist_train = torchvision.datasets.FashionMNIST(\n",
    "    root=\"../../data\", train=True, transform=transforms.ToTensor(), download=True)\n",
    "mnist_test = torchvision.datasets.FashionMNIST(\n",
    "    root=\"../../data\", train=False, transform=transforms.ToTensor(), download=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 构造神经网络\n",
    "lr = 0.05\n",
    "batch_size = 256\n",
    "epochs = 20\n",
    "net = nn.Sequential(nn.Flatten(),nn.Linear(784,10)) # 这里应该是对一张图片的sequential\n",
    "loss = nn.CrossEntropyLoss()\n",
    "optim = torch.optim.SGD(net.parameters(),lr)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 同样的要实现随机挑选指定数量的样本\n",
    "train_iter = data.DataLoader(mnist_train, batch_size=batch_size, shuffle=True)\n",
    "test_iter = data.DataLoader(mnist_test, batch_size=batch_size, shuffle=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "metadata": {},
   "outputs": [],
   "source": [
    "def train():\n",
    "    for epoch in range(epochs):\n",
    "        for x,y in train_iter:\n",
    "            y_hat = net(x)\n",
    "            l = loss(y_hat, y)\n",
    "            optim.zero_grad()\n",
    "            l.backward()\n",
    "            optim.step()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "metadata": {},
   "outputs": [],
   "source": [
    "train()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 123,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.8357421875"
      ]
     },
     "execution_count": 123,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "def accuracy(y_hat:torch.Tensor, y):\n",
    "    fin_output = y_hat.argmax(dim=1)\n",
    "    cmp = fin_output.type(y.dtype) == y\n",
    "    return float(cmp.type(y.dtype).sum())/len(y)\n",
    "def emulate():\n",
    "    num = 0\n",
    "    sum = 0\n",
    "    net.eval()\n",
    "    for x,y in test_iter:\n",
    "        sum += accuracy(net(x),y)\n",
    "        # print(accuracy(net(x),y))\n",
    "        num += 1\n",
    "    return sum/num\n",
    "\n",
    "emulate()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 133,
   "metadata": {},
   "outputs": [],
   "source": [
    "import random\n",
    "def show_img(img:torch.Tensor, rows = 28, cols = 28): # 显示图片\n",
    "    plt.imshow(img.reshape((rows, cols)),cmap=\"gray\")\n",
    "def get_fashion_mnist_labels(labels):  \n",
    "    \"\"\"返回Fashion-MNIST数据集的文本标签输入是多个标签\"\"\"\n",
    "    text_labels = ['t-shirt', 'trouser', 'pullover', 'dress', 'coat',\n",
    "                   'sandal', 'shirt', 'sneaker', 'bag', 'ankle boot']\n",
    "    return [text_labels[int(i)] for i in labels]\n",
    "def emulate_vision():\n",
    "    length = len(mnist_test)\n",
    "    rand = int(random.random()*length)\n",
    "    print(\"sample:\",rand)\n",
    "    o = net(mnist_test[rand][0])\n",
    "    y_hat = o.argmax()\n",
    "    show_img(mnist_test[rand][0])\n",
    "    y = mnist_test[rand][1]\n",
    "    print((y_hat==y).item())\n",
    "    print(f\"predict:{get_fashion_mnist_labels([y_hat])[0]}\\nactrully:{get_fashion_mnist_labels([y])[0]}\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 138,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "sample: 509\n",
      "True\n",
      "predict:pullover\n",
      "actrully:pullover\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0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XCldTh06FAwbdq0IDc3N4hEIsG1114b/OxnPwuam5ttGz8Pb8cAADCR9M8BAQD6JgIIAGCCAAIAmCCAAAAmCCAAgAkCCABgggACAJgggAAAJgggAIAJAggAYIIAAgCYIIAAACb+D4TRomnL/Ho0AAAAAElFTkSuQmCC",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "\n",
    "emulate_vision()"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "base",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.11.7"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
